import { View, Text, Image } from '@tarojs/components';

import wechatImg from '@/assets/images/user/icon/wechat@2x.png';
import ticketImg from '@/assets/images/user/icon/ticket@2x.png';
import securityImg from '@/assets/images/user/icon/security@2x.png';
import serviceImg from '@/assets/images/user/icon/service@2x.png';
import Taro from '@tarojs/taro';

import './style.scss';

const orderTypeList = [
  {
    img: wechatImg,
    title: '关注优惠',
    path: '/subPages/youhui/index',
  },
  {
    img: ticketImg,
    title: '发票中心',
  },
  {
    img: securityImg,
    title: '服务保障',
  },
  {
    img: serviceImg,
    title: '客服帮助',
    // path: '/subPages/serviceHelp/index',
  },
];
/**
 * 更多服务
 * @returns
 */
const MoreService = () => {
  const clickSettingItem = (path?: string) => {
    if (path) {
      Taro.navigateTo({
        url: path,
      });
    } else {
      Taro.makePhoneCall({
        phoneNumber: '13810701426',
      });
    }
  };
  return (
    <View className="more-service-wrap">
      {orderTypeList.map((item, index) => (
        <View onClick={() => clickSettingItem(item?.path)} key={index} className="service-item">
          <Image mode="aspectFill" src={item.img} />
          <Text>{item.title}</Text>
        </View>
      ))}
    </View>
  );
};
export default MoreService;
